package com.hlz.lib.effectivejava.chapter3;

import com.google.common.base.Objects;

import java.util.concurrent.CountDownLatch;

/**
 * @author Hongliang Zhu
 * @create 2023-08-24 22:53
 */
public class EqualsDemo {

    private int a;
    private String name;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof EqualsDemo)) {
            return false;
        }
        EqualsDemo that = (EqualsDemo) o;
        return a == that.a &&
                Objects.equal(name, that.name);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(a, name);
    }


}
